#include "mtpMessageHandler.h"
#include "opResMessage.h"
#include "stringUtils.h"

void MtpMessageHandler::handle(Message<String>* message, const IPaddress& attachment)
{
	handle((MtpMessage*)message, attachment);
}

Message<String>* MtpMessageHandler::decode(Protocol<String>* packet, const IPaddress& attachment)
{
	return decode((MtpProtocol*)packet, attachment);
}

void MtpMessageHandler::handleMessageError(Message<String>* message, const IPaddress& attachment, std::exception& e)
{
	OpResMessage msg(false, StringUtils::String2Wstring(e.what()), (MtpMessage*)message);
	msg.send(attachment);
	MessageHandler::handleMessageError(message, attachment, e);
}
